<?php

namespace App\Transformers;

use League\Fractal\TransformerAbstract;

class PeriodTransformer extends TransformerAbstract
{

    public function transform($item)
    {
        return [
            "coach_id"=>$item->coach_id,
            "km"=>$item->km,
            "startime"=>$item->startime,
            "endtime"=>$item->endtime,
            "minute"=>$item->minute,
            "price"=>$item->price,
            "study_time"=>$item->study_time,
            "chargeback_type"=>'',
            "ssms"=> $item->ssms,
            "ispick_up" => $item->is_pickup,
            "max" => $item->max,
            "stu_putime_pickup_number"=>$item->pickup_num,
            "onhours"=> '',
            "coach_name"=>$item->coach->name,
            "time_left" => $item->time_left,
            "teach_area" => isset($item->teacharea) ? $item->teacharea->name : '',
        ];

    }


}
